# $ Using the DCL Editor
Creating, Opening, Saving, and Printing Scripts
{bml j_bullet.bmp}Creating a New Script
{bml j_bullet.bmp}Opening an Existing File
{bml j_bullet.bmp}Opening a Recent File
{bml j_bullet.bmp}Saving a New Script
{bml j_bullet.bmp}Saving an Existing File
{bml j_bullet.bmp}Saving an Existing File Under a New Name
{bml j_bullet.bmp}Making an Executable from the Current Script
{bml j_bullet.bmp}Distributing an Executable
{bml j_bullet.bmp}Printing a Script
{bml j_bullet.bmp}Setting Up for Printing
{bml j_bullet.bmp}Exiting DCL Editor
Working with Text
{bml j_bullet.bmp}Editing Text
{bml j_bullet.bmp}Selecting Text
{bml j_bullet.bmp}Text Editing Keys
{bml j_bullet.bmp}Finding Text
{bml j_bullet.bmp}Replacing Text
Using the Toolbar and Status Bar
{bml j_bullet.bmp}Using the Toolbar
{bml j_bullet.bmp}Using the Status Bar
Running Scripts
{bml j_bullet.bmp}Running a Script
Using Tools
{bml j_bullet.bmp}Starting the Debugger
{bml j_bullet.bmp}Starting the Dialog Editor
{bml j_bullet.bmp}Recording a Macro
{bml j_bullet.bmp}Events Recorded by DCL
{bml j_bullet.bmp}Checking the Syntax
Using Windows
{bml j_bullet.bmp}Working with Document Windows
Getting Help
{bml j_bullet.bmp}Getting Help
Commands
{bml j_bullet.bmp}DCL Editor Commands

# $ K + Creating a New Script
To create a new script:
1.	Choose the New command from the File menu.
2.	Enter the commands that make up the script.
	If you need help for a particular command, position the cursor on the line containing the command and press F1.
3.	Save your script as described under Saving a New Script.
4.	Run your script as described under Running a Script.

# $ K + Opening an Existing File
To open an existing file:
1.	Choose the Open command from the File menu.
	The File Open dialog box is displayed.
{bml open.shg}
2.	Select the Drive and Directory containing the file.
3.	Enter the File Name. Or select the file from the File Name list box.
	You can change the types of files displayed in the File Name list box by selecting another file type from the List Files of Type box.
4.	Choose OK.

# $ K + Opening a Recent File
The last four files you saved are displayed toward the bottom of the File menu.
To open one of these files, choose the file name from the File menu.

# $ K + Saving a New Script
To save a new script:
1.	Choose the Save command from the File menu.
	The File Save As dialog box is displayed.
{bml save_as.shg}
2.	If you need to change the current path, select the Drive and Directory to contain the file.
3.	Enter the File Name.
4.	Choose OK.

# $ K + Saving an Existing File
To save an existing file, choose the Save command from the File menu.

# $ K + Saving an Existing File Under a New Name
To save an existing file under a new name:
1.	Choose the Save As command from the File menu.
	The File Save As dialog box is displayed.
{bml save_as.shg}
2.	If you want to change the current path, select the Drive and Directory to contain the file.
3.	Enter the File Name.
4.	From the Save File As Type box, select the desired file type.
5.	Choose OK.
	If a file having the same name already exists, you will be asked to confirm that you want to overwrite the file.

# $ K + Making an Executable from the Current Script
To make an executable from the current script:
1.	Choose the Make Exe command from the File menu.
	The Make Executable dialog box is displayed.
{bml make_exe.shg}
2.	Select the Target Operating SystemWindows or DOS.
3.	If you want to change the current path, select the Drive and Directory to contain the file.
4.	Enter a new File Name or accept the default executable name.
5.	Choose OK.
	If a file having the same name already exists, you will be asked to confirm that you want to overwrite the file.
Note: If you create an executable to run under DOS, make sure the DCL commands in your script are supported under DOS. The Desktop Control Language Reference indicates if a command is not supported under DOS.
Related Topic:
{bml j_bullet.bmp}Distributing an Executable

# $ K + Distributing an Executable
When you distribute an executable to users in your organization to run under Windows, the following files must be in the same directory as the executable or on the path:
{bmc bullet.bmp}	ADSCON11.EBL
{bmc bullet.bmp}	ADSENV.DLL
{bmc bullet.bmp}	ADSPUB11.DLL
{bmc bullet.bmp}	ADSRUN11.DLL
{bmc bullet.bmp}	ADSUTILS.DLL
{bmc bullet.bmp}	CTL3D.DLL
{bmc bullet.bmp}	DCL.EBL
{bmc bullet.bmp}	WWNETWAR.DLL	(For network functionality)
{bmc bullet.bmp}	WWNET.INI	"
{bmc bullet.bmp}	NWCALLS.DLL	"
{bmc bullet.bmp}	NWLOCALE.DLL	"
{bmc bullet.bmp}	NWNET.DLL	"
No support files are required for executables running under DOS.

# $ K + Printing a Script
To print a script:
1.	Choose the Print command from the File menu.
	The Print dialog box is displayed.
{bml print.shg}
2.	If you want to change the printer or printer settings, choose the Setup button and see Setting Up for Printing.
3.	Select the Print Range.  Your choices are all of the file or a range of pages.
4.	Change any of these print options as desired:  Print Quality (depending on your printer), Copies, Collate Copies.
5.	Choose OK.

# $ K + Setting Up for Printing
To set up your printer:
1.	Choose the Print Setup command from the File menu.
	The Print Setup dialog box is displayed.
{bml printset.shg}
2.	Select the Default Printer or another Specific Printer.
3.	Select the Orientation of the paper: portrait or landscape.
4.	Select the desired Paper Size and Source, depending on your printer.
5.	If you want to change the setting for your printer, choose the Options button.  One or more dialog boxes specific to your printer will be displayed.
6.	Choose OK.

# $ K + Exiting DCL Editor
To exit DCL Editor, choose the Exit command from the File menu.

# $ K + Editing Text
The DCL Editor functions like other Windows text editors.
Use the Cut command on the Edit menu to remove a block of text you have selected from your script and store it in the Windows clipboard.
Use the Copy command to copy the selected text to the clipboard.
Use the Paste command to insert the text currently in the clipboard at the insertion point in the current document window.
Use the Select All command to select all of the text in the current document window.
Use the Move Text Left and Move Text Right commands to shift the selected text one tab stop left or right.
Use the Undo command to undo the last editing operation.
Related Topic:
{bml j_bullet.bmp}Text Editing Keys
{bml j_bullet.bmp}Selecting Text

# $ K + Selecting Text
To Select a block of text for an editing operation:
1	Position the insertion point at the beginning of the text to be selected and click the left mouse button.
2	Move the insertion point to the end of the block to be selected.
3	Hold down the Shift key and press the left mouse button.
	OR
1	Move the insertion point to the beginning of the text to be selected.
2	Hold the Shift key.
3	Move the cursor to the end of the text to be selected.
You can choose the Select All command from the Edit menu to select all of the text in the current document window.
Related Topic:
{bml j_bullet.bmp}Editing Text

# $ K + Finding Text
To find a string of text in a script:
1.	Choose the Find command from the Edit menu.
	The Find dialog box is displayed.
{bml find.shg}
2.	Enter the text string to search for in the Find What text box.
	Shortcut:  If you select the text you want to search for before choosing the Find command, the selected text is put in the Find What text box for you.
3.	Select the Match Case check box if you want the search to differentiate between upper- and lowercase letters.
4.	Specify the Direction of the searchup or down.
5.	Choose the Find Next button to begin the search.
	The first occurrence of the string after the insertion point is highlighted.
6.	To continue searching for subsequent occurrences of the string, choose Find Next.
	The next occurrence of the string is highlighted.
Hint:  You can edit the script the with the Find dialog box displayed. Use the mouse or press Alt+F6 to move between the dialog box and the script.

# $ K + Replacing Text
To replace one text string with another:
1.	Choose the Replace command from the Edit menu.
	The Replace dialog box is displayed.
{bml replace.shg}
2.	Enter the text string to search for in the Find What text box.
	Shortcut:  If you select the text you want to search for before choosing the Replace command, the selected text is put in the Find What text box for you.
3.	Enter the replacement text in the Replace With box.
4.	Select the Match Case check box if you want the search-and-replace operation to differentiate between upper- and lowercase letters.
5.	Choose the Find Next button to begin the search.
	The first occurrence of the string after the insertion point is highlighted.
6.	If you want to substitute the replacement text for the string, choose the Replace button.  (The search for the next matching string continues after the replacement is made.)
	OR
	If you want to go on to the next occurrence of the string without making the text change, choose the Find Next button.
	OR
	If you want to change all subsequent occurrences of the string to the replacement text, choose the Replace All button. (To avoid accidental changes, we recommend that you use this feature with caution.)

# $ K + Using the Toolbar
The Toolbar is a row of buttons representing frequently used DCL Editor commands.  Instead of using the menus, you can choose a Toolbar button to execute a command.
The Toolbar looks like this.  Click any button you want information about.
{bml ed_toolb.shg}
To toggle the Toolbar display on or off, choose Toolbar from the View menu.

# $ K + Using the Status Bar
The Status Bar appears at the bottom of the DCL Editor window. The Status Bar looks like this.
{bml statusb.bmp}
When a menu is displayed, the Status Bar provides a description of the currently selected item. 
The Status Bar also indicates when the Caps Lock or Num Lock key is on.
The current line and column of the cursor are displayed in far right corner of the Status Bar.
To toggle the display of the Status Bar on or off, choose Status Bar from the View menu.

# $ K + Running a Script
To run a script that does not use command-line arguments, choose Start Script from the Run menu.
To run a script that uses command-line arguments, follow these steps:
1.	Choose the Arguments command from the Run menu.
	The Set Arguments dialog box is displayed.
{bml set_args.shg}
2.	In the Set Arguments dialog box, enter the command-line arguments to be passed to the script's main subroutine and choose OK. (In your script, you can get these arguments through the Command$ statement.)
3.	Choose Start Script from the Run menu.
To stop the script that is currently executing, choose End Script from the Run menu.
Running Executables:  If the script has been saved as an executable file (using the File/Make Exe command), you can use the Applications Manager or Program Manager File/Run function or File Manager to run the script. For more information, see Making an Executable from the Current Script.

# $ K + Starting the Debugger
To start the DCL Debugger, choose Debugger from the Tools menu.
Related Topic:
{bml j_bullet.bmp}Using the Debugger

# $ K + Starting the Dialog Editor
To start the DCL Dialog Editor, choose Dialog Editor from the Tools menu.
Related Topic:
{bml j_bullet.bmp}Using the Dialog Editor

# $ K + Recording a Macro
DCL's Recorder captures Windows events and translates them into DCL statements that can be inserted in a script. For a list of the of the events you can record, see Recorded Events.
To record Windows events:
1.	Choose Recorder from the Tools menu.
	The Script Recorder Options dialog box is displayed.
{bml rec_opt.shg}
2.	Make any desired changes to the dialog box:
{bmc bullet.bmp}	Include Comments: Indicate whether to include descriptive comments in the code generated by the Recorder.
{bmc bullet.bmp}	High-Level Statements: Indicate whether to consolidate multiple events into one High-Level Statement where possible. (For example, selecting a menu is recorded as a menu command rather than a series of mouse commands.)
{bmc bullet.bmp}	Keyboard: Indicate whether to capture events resulting from keyboard activity.
{bmc bullet.bmp}	Mouse: Indicate whether to capture events resulting from mouse activity then indicate whether the coordinate system is relative to the window or screen.
{bmc bullet.bmp}	Stop Recording On: Specify the key combination to stop the Recorder.
3.	Choose OK.
	The DCL Editor window is minimized. The Recorder window is displayed.
{bml rec_win.shg}
4.	Perform the Windows events you want to record. 
	You can interrupt recording by choosing the Pause button in the Recorder window. Then choose the Record button when you want to resume recording.
5.	When you have finished recording events, choose the End button in the Recorder window.
6.	The DCL Editor window is restored; the Insert Recording dialog box is displayed.
{bml ins_rec.shg}
7.	Press F9 (or use mouse) to switch to your script.
8.	Position the insertion point where you want to insert the recorded code.
9.	Press F9 (or use mouse) to switch back to the Insert Recording dialog box.
10.	Choose OK.
Related topic:
{bml j_bullet.bmp}Recorded Events

# $ K + Recorded Events
The Recorder recognizes the following Windows actions:
Application Focus Switch
The Recorder recognizes when an application receives the focus and records this as a WinActivate statement if you perform an activity within the application. The focus can be shifted using any of the normal Windows application switching methods (Alt+Tab, Ctrl+Esc, clicking the mouse on another application, selecting the "Switch To..." command from an application's control menu, etc.).
Window focus shifts are also recorded to ensure that subsequent actions occur (and are synchronized) within the appropriate window.
Statements:
{bml j_bullet.bmp}WinActivate
{bml j_bullet.bmp}AppActivate
Window Scrolling
Interactions with windows that respond to scrolling messages (windows that have built-in Windows scroll bars, like Notepad and Write) are recorded.
Statements
{bml j_bullet.bmp}VLine
{bml j_bullet.bmp}VPage
{bml j_bullet.bmp}HLine
{bml j_bullet.bmp}HPage
{bml j_bullet.bmp}HScroll
{bml j_bullet.bmp}VScroll
Mouse Activity
Mouse down and up actions are compressed to high-level forms when possible. Further, mouse activity that leads to a recognizable result, such as resizing a window, is compressed out completely.
Statements
{bml j_bullet.bmp}QueFlush
{bml j_bullet.bmp}QueMouseClick
{bml j_bullet.bmp}QueMouseDblClk
{bml j_bullet.bmp}QueMouseDblDn
{bml j_bullet.bmp}QueMouseDn
{bml j_bullet.bmp}QueMouseMove
{bml j_bullet.bmp}QueMouseUp
{bml j_bullet.bmp}QueSetRelativeWindow
Keyboard Activity
Keyboard press/release actions are converted. Complex key combinations, such as Ctrl+Escape or Alt+Shift+C are converted into a readable form. Keyboard activity that results in a higher level command are compressed out completely, such as the following keystroke sequence, which results in a window reposition: Alt+Space, M, Right, Right, Right, Enter.
Keyboard activity that modifies mouse events is also recorded, such as holding down the Shift key and clicking the left mouse button.
Statements
{bml j_bullet.bmp}DoKeys
{bml j_bullet.bmp}QueFlush
{bml j_bullet.bmp}QueKeys
{bml j_bullet.bmp}QueKeyDn
{bml j_bullet.bmp}QueKeyUp
Window Management
The Recorder recognizes high-level interactions with windows, such as movement, sizing, activation, minimizing, maximizing, and restoring. The Recorder differentiates between interactions with applications, popup windows, and child MDI windows.
Statements
{bml j_bullet.bmp}AppMaximize
{bml j_bullet.bmp}AppMinimize
{bml j_bullet.bmp}AppRestore
{bml j_bullet.bmp}AppMove
{bml j_bullet.bmp}AppSize
{bml j_bullet.bmp}WinMove
{bml j_bullet.bmp}WinSize
{bml j_bullet.bmp}WinMaximize
{bml j_bullet.bmp}WinMinimize
{bml j_bullet.bmp}WinRestore
Menu Commands
The Recorder watches for interactions with an application's built-in menu and records the results of these interactions. All intermediate events used to select the menu choice (with the keyboard and mouse) are not recorded.
Statement
{bml j_bullet.bmp}Menu
Dialog Box Interaction
The Recorder recognizes interactions with standard Windows controls, such as edit boxes, check boxes, options buttons, list boxes, and combo boxes. Also, interactions with known controls of other applications are supported, such as Borland's custom controls and the controls in Visual Basic. Note: The results of dialog box interactions are recorded rather than the mouse/keyboard actions which resulted in those changes.
The Recorder also recognizes mixed dialogs - dialog boxes with a mixture of standard controls and custom controls. Many applications such as Control Panel, Corel Draw, and Lotus Ami Pro, use this technique. In this case, standard control interactions are recorded normally, while interactions with custom controls are recorded using high-level mouse and keyboard statements.
Statements
{bml j_bullet.bmp}ActivateControl
{bml j_bullet.bmp}SelectComboBoxItem
{bml j_bullet.bmp}SelectButton
{bml j_bullet.bmp}SelectListboxItem
{bml j_bullet.bmp}SetCheckbox
{bml j_bullet.bmp}SetEditText
{bml j_bullet.bmp}SetOption

# $ K + Checking the Syntax
To check the syntax of your script:
1.	Choose Syntax Check from the Tools menu.
	Upon encountering an error, the syntax checker stops at the line containing the error and displays an error message in a message box and in the Status Bar.
2.	Correct the error.
3.	Repeat Steps 1 and 2 until your script is free of syntax errors. 
	If your script is free of errors, the message "Syntax OK" is displayed in the Status Bar.

# $ K + Working with Document Windows
DCL Editor allows you to have several scripts open for editing at the same time.  Each script is contained in a document window.  Document windows can be moved, resized, maximized to fill the entire screen, minimized to an icon, or restored.
The names of the currently open scripts are displayed at the bottom of the Window menu. To switch to another open script, choose the script name from the Window menu or click inside the window containing the script.
To display the document windows in a stair-step arrangement, choose the Cascade command form the Window menu.
To display the document windows in a tiled arrangement, choose Tile from the Window menu.
To neatly arrange the icons at the bottom of the DCL Editor window, choose Arrange Icons from the Window menu.

# $ K + Getting Help
DCL provides extensive Help that describes how to use the graphical script building environment and documents each DCL statement, function, system variable, etc.
To display the Table of Contents for the DCL Help, choose Contents from the Help menu.
To search an index of DCL Help keywords, choose Search for Help On from the Help menu.
For information on Microsoft Windows Help, choose How to Use Help from the Help menu.
Context Sensitive Help
When you request context-sensitive Help, DCL displays a particular Help topic, based on your current activity.  Context-sensitive Help is provided for each DCL language element, menu item, Toolbar button, and dialog box.
For Help on a particular DCL language element (statement, function, or system variable) enter the language element in the document and press F1.
For Help on a menu item (command):
1	Press Shift + F1 or choose the {bmc help_but.bmp} button from the Toolbar.
	The cursor changes to indicate that you are requesting context-sensitive Help.
2	Choose the menu and command you want Help on.
For Help on a Toolbar button:
1	Press Shift + F1 or choose the {bmc help_but.bmp} button from the Toolbar.
	The cursor changes to indicate that you are requesting context-sensitive Help.
2	Choose the Toolbar button you want Help on.
For Help on the current dialog box, choose the Help button.

# $ K + Text Editing Keys
You can use the following keys when exiting scripts:
Key	Description
Backspace	Delete the selection or delete the character preceding the cursor
Tab	Insert a tab character
Enter	Insert a new line, breaking the current line
Ctrl+Insert, Ctrl+C	Copy
Shift+Insert, Ctrl+V	Paste
Shift+Delete, Ctrl+X	Cut
Insert	Toggle between insert and overtype typing modes
Delete	Delete the selection or delete the character following the cursor
Up	Move the cursor up one line
Down	Move the cursor down one line
Left	Move the cursor left one character position
Right	Move the cursor right one character position
PgUp	Move the cursor up by one windowful
PgDn	Move the cursor down by one windowful
Ctrl+PgUp	Scroll the window left by one windowful
Ctrl+PgDn	Scroll the window right by one windowful
Ctrl+Left	Move the cursor left by one word
Ctrl+Right	Move the cursor right by one word
Home	Move the cursor to the start of the line
End	Move the cursor after the last character on the line
Ctrl+Home	Move the cursor to the first character in the macro
Ctrl+End	Move the cursor after the last character in the macro
Shift+Cursor Move	Drag the selection as the cursor moves
F1	Context-sensitive help for current command in editing window
Shift+F1	Context-sensitive help for current mouse cursor position